﻿namespace RawInput;

// ReSharper disable UnusedMember.Global
// ReSharper disable InconsistentNaming

public enum DataCommand : uint
{
    RID_HEADER = 0x10000005, // Get the header information from the RAWINPUT structure.
    RID_INPUT = 0x10000003   // Get the raw data from the RAWINPUT structure.
}

public static class DeviceType
{
    public const int RimTypemouse = 0;
    public const int RimTypekeyboard = 1;
    public const int RimTypeHid = 2;
}

internal enum RawInputDeviceInfo : uint
{
    RIDI_DEVICENAME = 0x20000007,
    RIDI_DEVICEINFO = 0x2000000b,
    PREPARSEDDATA = 0x20000005
}

[Flags]
internal enum RawInputDeviceFlags
{
    NONE = 0,                   // No flags
    REMOVE = 0x00000001,        // Removes the top level collection from the inclusion list. This tells the operating system to stop reading from a device which matches the top level collection. 
    EXCLUDE = 0x00000010,       // Specifies the top level collections to exclude when reading a complete usage page. This flag only affects a TLC whose usage page is already specified with PageOnly.
    PAGEONLY = 0x00000020,      // Specifies all devices whose top level collection is from the specified UsagePage. Note that Usage must be zero. To exclude a particular top level collection, use Exclude.
    NOLEGACY = 0x00000030,      // Prevents any devices specified by UsagePage or Usage from generating legacy messages. This is only for the mouse and keyboard.
    INPUTSINK = 0x00000100,     // Enables the caller to receive the input even when the caller is not in the foreground. Note that WindowHandle must be specified.
    CAPTUREMOUSE = 0x00000200,  // Mouse button click does not activate the other window.
    NOHOTKEYS = 0x00000200,     // Application-defined keyboard device hotkeys are not handled. However, the system hotkeys; for example, ALT+TAB and CTRL+ALT+DEL, are still handled. By default, all keyboard hotkeys are handled. NoHotKeys can be specified even if NoLegacy is not specified and WindowHandle is NULL.
    APPKEYS = 0x00000400,       // Application keys are handled.  NoLegacy must be specified.  Keyboard only.

    // Enables the caller to receive input in the background only if the foreground application does not process it. 
    // In other words, if the foreground application is not registered for raw input, then the background application that is registered will receive the input.
    EXINPUTSINK = 0x00001000,
    DEVNOTIFY = 0x00002000
}

public enum HidUsagePage : ushort
{
    UNDEFINED = 0x00,   // Unknown usage page
    GENERIC = 0x01,     // Generic desktop controls
    SIMULATION = 0x02,  // Simulation controls
    VR = 0x03,          // Virtual reality controls
    SPORT = 0x04,       // Sports controls
    GAME = 0x05,        // Games controls
    KEYBOARD = 0x07,    // Keyboard controls
}

public enum HidUsage : ushort
{
    Undefined = 0x00,       // Unknown usage
    Pointer = 0x01,         // Pointer
    Mouse = 0x02,           // Mouse
    Joystick = 0x04,        // Joystick
    Gamepad = 0x05,         // Game Pad
    Keyboard = 0x06,        // Keyboard
    Keypad = 0x07,          // Keypad
    SystemControl = 0x80,   // Muilt-axis Controller
    Tablet = 0x80,          // Tablet PC controls
    Consumer = 0x0C,        // Consumer
}
